import { defineConfig } from 'rollup';
import nodeResolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import esbuild, { minify } from 'rollup-plugin-esbuild';

export default defineConfig({
  input: 'src/index.ts',
  plugins: [
    nodeResolve(),
    commonjs(),
    esbuild({
      target: 'es2015',
    }),
  ],
  output: [
    {
      file: 'dist/index.js',
      format: 'umd',
      name: 'SystemJSPluginLoadStyle',
    },
    {
      file: 'dist/index.min.js',
      format: 'umd',
      name: 'SystemJSPluginLoadStyle',
      plugins: [minify()]
    }
  ],
  external: ['systemjs']
});